package com.navinfo.platform.score.utils;

import com.googlecode.aviator.AviatorEvaluator;
import com.googlecode.aviator.Expression;

import java.util.Map;

/**
 * @author CAI
 */
public class AviatorUtils {

    public static Expression compile(String expression){
        return AviatorEvaluator.compile(expression);
    }

    public static Long execute(Map<String, Object> env, Expression compiledExp){
        // 执行表达式
        return (Long) compiledExp.execute(env);
    }
}
